package com.xbongbong.saas.enums.base;

import lombok.Getter;

import java.util.Objects;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/4/9 18:03
 * @since v1.0
 */
@Getter
public enum CommunicateBaseEnum {
    /**
     * 基本信息
     */
    BASE_INFO("other_1"),
    MAIN_BUSINESS("text_1"),
    CONTACT("text_3"),
    TYPE("text_4"),
    COMMUNICATE_TIME("date_1"),
    COMMUNICATE_BUSINESS("text_5"),
    MEMO("text_6"),
    VIDEO("file_4"),
    ADDRESS("geo_1"),
    IMAGE("file_1"),
    FILE("file_3"),
    /**
     * 关联信息
     */
    ASSOCIATED_INFO("other_2"),
    IS_REMIND("num_3"),
    NEXT_COMMUNICATE_TIME("date_2"),
    NOTIFY_TYPE("text_20"),
    NOTIFY_TIME("date_3"),
    NEXT_NOTIFY_MEMO("text_21"),
    ENTER_COMMUNICATE_PLAN("num_4"),
    FINISH_COMMUNICATE_PLAN_ID("text_7"),
    /**
     * 系统信息
     */
    SYSTEM_INFO("other_3"),
    CREATOR_ID("creatorId"),
    ADD_TIME("addTime"),
    UPDATE_TIME("updateTime"),
    /**
     * 隐藏逻辑字段
     */
    AUTO_GEN("num_2"),
    USER_ID("text_11"),
    USER_NAME("text_12"),
    USER_AVATAR("file_2"),
    MAIN_BUSINESS_HIDE("text_13"),
    CONTACT_HIDE("text_14"),
    FINISH_COMMUNICATE_PLAN_LINK_TEXT("text_17"),
    COMMUNICATE_BUSINESS_TYPE("num_1"),
    COMMUNICATE_BUSINESS_HIDE("text_19"),
    AT_USERNAME("array_26"),
    ;
    private String attr;

    CommunicateBaseEnum(String attr) {
        this.attr = attr;
    }

    public static Boolean isDetailRemove(String attr){
        return Objects.equals(attr,USER_ID.attr) || Objects.equals(attr,USER_NAME.attr) || Objects.equals(attr,USER_AVATAR.attr)
                || Objects.equals(attr,TYPE.attr) || Objects.equals(attr,MAIN_BUSINESS.attr) || Objects.equals(attr,MAIN_BUSINESS_HIDE.attr)
                || Objects.equals(attr,CONTACT.attr) || Objects.equals(attr,CONTACT_HIDE.attr) || Objects.equals(attr,COMMUNICATE_BUSINESS.attr)
                || Objects.equals(attr,COMMUNICATE_BUSINESS_TYPE.attr) || Objects.equals(attr,MEMO.attr)
                || Objects.equals(attr,ADDRESS.attr) || Objects.equals(attr,IMAGE.attr) || Objects.equals(attr,COMMUNICATE_TIME.attr);
    }
}
